// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TaskDispatcher.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Defines the TaskDispatcher type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.Threading
{
    using System;

    public class TaskDispatcher : ITaskDispatcher
   {
      #region Fields

      private readonly IDispatcher _invokeDispatcher;
      private readonly IDispatcher _returnDispatcher;

      #endregion

      public TaskDispatcher(IDispatcher invokeDispatcher, IDispatcher returnDispatcher)
      {
         _invokeDispatcher = invokeDispatcher;
         _returnDispatcher = returnDispatcher;
      }

      public void BeginInvoke(Action action)
      {
         _invokeDispatcher.BeginInvoke(action);
      }

      public void BeginReturn(Action action)
      {
         _returnDispatcher.BeginInvoke(action);
      }
   }
}